import java.util.Random;

public class CaptchaUtil {
    // 生成 4 位随机数字验证码
  
    public static String generateCaptcha() {
        Random random = new Random();
        return String.format("%04d", random.nextInt(10000));
    }
}